1. Field of the Invention
This invention relates to an image processing apparatus and method and, more particularly, to an image processing apparatus and method which performs correction processing such as exposure compensation and white balance adjustment for digital images.
2. Description of the Related Art
Various types of image processing apparatuses having the functions of performing various processes and correction processing in forming multivalued digital images have been proposed and put into practice.
For example, some of these apparatuses are designed to perform exposure compensation for images. Exposure compensation in a conventional image processing apparatus is implemented by adjusting the luminance of an original image by increasing/decreasing the overall luminance.
In addition, some of the above image processing apparatus perform so-called white balance adjustment to obtain an image with high contrast by adjusting the luminance of a highlight portion which is the brightest portion of an image or a shadow portion which is the darkest portion. In white balance adjustment in the conventional image processing apparatus, the average luminances of R, G, and B pixels, except for pixels having luminances higher than a predetermined threshold, in a predetermined high-luminance area corresponding to a high-luminance range several % from the maximum luminance of an image are calculated, and the respective pixels are corrected on the basis of the average luminances.
In the above image correcting apparatus, exposure compensation does not take contrast information such as the highlight or shadow point of the image into consideration.
For this reason, the exposure state of the original image cannot be properly checked, and proper exposure compensation cannot always be performed.
Likewise, white balance adjustment in the conventional image processing apparatus does not take image features such as the scene features presented by a target image into consideration. For this reason, if, for example, all the pixels in a high-luminance area of the image have luminances equal to or higher than a predetermined threshold, since there are no pixels from which average luminances are calculated, white balance adjustment cannot be performed.
For example, a photographic image including a fluorescent lamp in a room as an object image has a so-called blue cast, i.e., the tone of the picture darkens in portions other than the fluorescent lamp. Even if white balance adjustment is performed for such a photographic image, since all the pixels corresponding to the fluorescent lamp have luminances equal to or higher than the predetermined threshold, effective adjustment cannot be performed. Hence, the blue cast cannot be corrected.
In addition, when white balance adjustment is uniformly performed for any scenes, some scene may deteriorate in image quality. If, for example, strong white balance adjustment is performed for a xe2x80x9csunsetxe2x80x9d scene or xe2x80x9cflower gardenxe2x80x9d scene, the scene is bleached out, and the xe2x80x9csunsetxe2x80x9d scene may not look like a sunset.
Accordingly, it is an object of the present invention to provide an image processing apparatus and method which can perform proper white balance adjustment for any images.
According to the present invention, the foregoing object is attained by providing an image processing apparatus comprising an image processing apparatus comprising extraction means for extracting a highlight area on the basis of a color distribution of an input image; calculation means for calculating white balance of the input image on the basis of pixels having luminances less than a predetermined highlight point in the highlight area; and setting means for setting a gradation correction condition on the basis of the white balance and the highlight point.
With this arrangement, proper white balance adjustment can be performed in accordance with image features.
And it is another object of the present invention to provide an image processing apparatus and method which can perform proper exposure compensation for any images.
According to the present invention, the foregoing object is attained by providing an image processing apparatus comprising an image processing apparatus comprising; extraction means for extracting highlight and shadow areas on the basis of a color distribution of an input image; calculation means for calculating an average luminance on the basis of the color distribution of the input image and calculating a target luminance on the basis of the average luminance and the highlight and shadow areas; and setting means for setting an exposure compensation condition on the basis of the target luminance.
With this arrangement, proper exposure compensation can be performed in accordance with image features.
And it is another object of the present invention to provide an image processing apparatus and method which perform proper white balance adjustment in accordance with the scene presented by an image.
According to the present invention, the foregoing object is attained by providing an image processing apparatus comprising an image processing apparatus comprising: extraction means for extracting a highlight area on the basis of a color distribution of an input image; calculation means for calculating white balance of the input image on the basis of pixels having luminances less than a predetermined highlight point in the highlight area; highlight correction means for correcting the highlight point in accordance with a first image feature; white balance correction means for correcting the white balance in accordance with a second image feature; and setting means for setting a gradation correction condition on the basis of the corrected highlight point and white balance.
With this arrangement, proper white balance adjustment can be performed in accordance with the scene presented by an image.
The invention is particularly advantageous since white balance adjustment and exposure compensation can be performed in accordance with image features by considering the arrangements of pixel values in the highlight and shadow areas of an image, and proper correction processing can be performed for any images.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.